home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0084_Simulate Phone Ringing.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-28  |  1KB  |  57 lines

  1. {
  2.  > I stumbled across the correct sequence
  3.  
  4.  Well, why don't we let some more people stumble in on our little secret? :)
  5.  
  6. Something like this might do the trick. The brute delay code 'asm hlt end',
  7. that simply waits for the next interrupt (should be the timer IRQ) to occur,
  8. may not work on some machines -- especially when running some multitaskers.
  9. If so it can be changed to 'delay(50)' or something like that.
  10. }
  11.  
  12. program Ring;
  13. uses crt;
  14. var i:word;
  15. begin
  16.   for i:=0 to 6 do
  17.   begin
  18.       sound(523); asm hlt end;
  19.   Delay(50);
  20.       sound(659); asm hlt end;
  21.   Delay(50);
  22.   end;
  23.   nosound
  24. end.
  25.  
  26. { Or, for those of you that don't like the crt unit, here's the same thing in
  27.   BASM: }
  28.  
  29. program Ring;
  30. begin
  31.   asm
  32.     mov   al,0B6h
  33.     out   43h,al
  34.     in    al,61h
  35.     or    al,3
  36.     out   61h,al
  37.     mov   cx,7
  38.     mov   dx,42h
  39. @the_loop:
  40.     mov   al,0E9h
  41.     out   dx,al
  42.     mov   al,8
  43.     out   dx,al
  44.     hlt
  45.     mov   al,12h
  46.     out   dx,al
  47.     mov   al,7
  48.     out   dx,al
  49.     hlt
  50.     loop  @the_loop
  51.     in    al,61h
  52.     and   al,0FCh
  53.     out   61h,al
  54.   end;
  55. end.
  56.  
  57.